package com.hu;

public class CalendarTest {
	
	private int[] LEAP = {31,29,31,30,31,30,31,31,30,31,30,31};
	private int[] PLAIN ={31,28,31,30,31,30,31,31,30,31,30,31};
	
	public boolean isLeapYear(int year){
		boolean isS= false;
		if ((year%4==0&&year%100!=0)||year%400==0) {
			isS=true;
		}
		return isS;
	}
	
	public int days(int year){
		int tot=0;
		for (int i = 1; i < year; i++) {
			if (isLeapYear(i)) {
				tot+=366;
			}else{
				tot += 365;
			}
		}
		return tot;
	}
	
	public int days(int year, int month){
		int tot=days(year, month);
		for (int i = 1; i < month ; i++) {
			if (isLeapYear(year)) {
				tot=LEAP[i-1];
			}else{
				tot=PLAIN[i-1];
			}
		}
	
		return tot;
	}
	
	public int days (int year, int month, int day){
		return days(year, month)+day;
	}
	
	public int lastDay(int year, int month){
		return isLeapYear(year)?LEAP[month-1]:PLAIN[month-1];
	}
	
	public  void calPrint(int year){
		for (int i = 1; i <= 12; i++) {
			
		}
	}
}
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
